home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / userid201.lha / UserID / Install_UserID next >
Text File  |  1994-12-25  |  9KB  |  285 lines

  1. ; $VER: UserID Install 2.01 (12.22.94) by Jason Gouger
  2.  
  3. (set source-dir (pathonly (expandpath @icon)))
  4.  
  5. (procedure install-exit
  6.     (complete 100)
  7.     (transcript "\nPlease support the ShareWare concept.\n")
  8.     (set @default-dest UserID-Dir)
  9.     (exit @app-name" is ShareWare\n\nPlease support the ShareWare concept!")
  10. )
  11.  
  12. (procedure select-destination-directory
  13.     (set destdir
  14.         (askdir
  15.             (prompt "In which drawer should "@app-name" be installed?") 
  16.             (help "You should install "@app-name" in the Doors Path defined in the MEBBSNet configuration.")
  17.             (default "DOORS:")
  18.            (newpath)
  19.         )
  20.     )
  21.     (set UserID-Dir(tackon destdir "UserID"))
  22. )
  23.  
  24. (procedure copy-userid-text
  25.     (set Text-Dir(tackon UserID-dir "Text"))
  26.     (transcript "\nCopying UserID.[txt] files...\n")
  27.     (makedir(Text-Dir))
  28.     (copyfiles
  29.         (source (tackon source-dir "Text")) (dest Text-Dir)
  30.         (pattern "UserID.#?")
  31.         (files)
  32.     )
  33. )
  34.  
  35. (procedure copy-userid-prg
  36.     (copyfiles
  37.         (source source-dir) (dest UserID-Dir)
  38.         (pattern "UserID")
  39.         (files)
  40.     )
  41. )
  42.  
  43. (procedure copy-userid-dat
  44.     (transcript "\nCopying default data file...\n")
  45.     (copyfiles
  46.         (source source-dir) (dest UserID-Dir)
  47.         (pattern "UserID.DAT")
  48.         (files)
  49.     )
  50. )
  51.  
  52. (procedure copy-userid-doc
  53.     (transcript "\nCopying documentation...\n")
  54.     (copyfiles
  55.         (source source-dir) (dest UserID-Dir)
  56.         (pattern "UserID.guide")
  57.         (files)
  58.         (if(= 1 install-icons) (infos))
  59.     )
  60.     (if ((exists "SYS:Utilities/MultiView")) 
  61.         (tooltype(
  62.             (dest (tackon UserID-Dir "UserID.guide"))
  63.             (setdefaulttool "SYS:Utilities/MultiView")
  64.         ))
  65.         (tooltype(
  66.             (dest (tackon UserID-Dir "UserID.guide"))
  67.             (setdefaulttool "SYS:Utilities/AmigaGuide")
  68.         ))
  69.     )
  70. )
  71.  
  72. (procedure copy-shell-games
  73.     (if (askbool
  74.         (prompt "Would you like to install the example Shell Game scripts?")
  75.         (help "Selecting YES to this option will Install the Optional Shell Game "
  76.                 "scripts.  These scripts ARE NOT needed for the operation of UserID. "
  77.                 "These scripts need customization, therefore it is not recommended "
  78.                 "for 'non-programming' oriented sysop's.\n\nNote: These scripts "
  79.                 "require the DosDriver program."))
  80.         ((transcript "\nCopying Example Shell Game Strartup Scripts...\n")
  81.         (copyfiles
  82.             (source (tackon source-dir "ShellGames")) (dest (tackon UserID-Dir "ShellGames"))
  83.             (pattern "#?")
  84.             (files)
  85.             (if(= 1 install-icons) (infos))
  86.         ))
  87.     )
  88. )
  89.  
  90. (procedure add-userid-logon
  91.     (if (askbool
  92.         (prompt "Would you like the "@app-name" door appended to your Logon.[txt] file(s)?")
  93.         (help "Selecting YES to this option will append the UserID Door call to the "
  94.             "end of your Logon.[txt] file(s). followed by a 'Press return'."))
  95.         ((set logon-txt-dir
  96.             (askdir
  97.                 (prompt "In which drawer are the LogOn.[txt] file(s) located?") 
  98.                 (help "Select the directory in which the MEBBSNet text files are stored.")
  99.                 (default "MEBBSNet:Txt")
  100.                (newpath)
  101.             )
  102.         )
  103.  
  104.         (if (= 2 (exists logon-txt-dir))
  105.             ((set logon-text "\n~v!DOOR/")
  106.             (set logon-text (cat logon-text UserID-Dir))
  107.             (set logon-text (cat logon-text "/UserID#\n\n~vc\n"))
  108.  
  109.             (if (askbool
  110.                 (prompt "Are you sure you would like to have the following appended to "
  111.                           "your LogOn.[txt] file(s)?\n\n"logon-text)
  112.                 (help "Selecting YES to this option will ALTER your LogOn.[txt] file(s) "
  113.                         "so that UserID will be executed upon logon."))
  114.                 ((foreach logon-txt-dir "(LogOn.txt|LogOn.gr#?)"
  115.                     ((set source-name (tackon logon-txt-dir @each-name))
  116.                     (textfile 
  117.                         (dest source-name) 
  118.                         (include source-name)
  119.                         (append logon-text)
  120.                         (prompt "Are you sure you would like to have the following appended to "
  121.                                   "the '"source-name"' file?\n\n"logon-text)
  122.                         (help "Selecting YES to this option will ALTER the '"source-name"' file "
  123.                                 "so that UserID will be executed upon logon.")
  124.                         (confirm "Expert") 
  125.                     ))
  126.                 ))
  127.             )
  128.         ))
  129.     ))
  130. )
  131.  
  132. (procedure add-timeon-logoff
  133.     (if (askbool
  134.         (prompt "Would you like the the TimeOn door appended to your Logoff.[txt] file(s)?")
  135.         (help "Selecting YES to this option will append the TimeOn Door call to the "
  136.                "end of your Logoff.[txt] file(s).\n\nNote: The Logoff.[txt] file(s) MUST "
  137.                 "be displayed through MEBBSNet, and NOT through another door application. "
  138.                 "If you have installed the DEFAULT MEBBSNet configuration, this door "
  139.                 "should function properly."))
  140.         ((set logoff-txt-dir
  141.             (askdir
  142.                 (prompt "In which drawer are the LogOff.[txt] file(s) located?") 
  143.                 (help "Select the directory in which the MEBBSNet text files are stored.")
  144.                 (default "MEBBSNet:Txt")
  145.                (newpath)
  146.             )
  147.         )
  148.  
  149.         (if (= 2 (exists logoff-txt-dir))
  150.             ((set logoff-text "\n~v!DOOR/")
  151.             (set logoff-text (cat logoff-text UserID-Dir))
  152.             (set logoff-text (cat logoff-text "/TimeOn#\n\n"))
  153.  
  154.             (if (askbool
  155.                 (prompt "Are you sure you would like to have the following appended to "
  156.                           "your LogOff.[txt] file(s)?\n\n"logoff-text)
  157.                 (help "Selecting YES to this option will ALTER your LogOff.[txt] file(s) "
  158.                         "so that they display the total connect time upon a user logoff."))
  159.                 ((foreach logoff-txt-dir "(LogOff.txt|LogOff.gr#?)"
  160.                     ((set source-name (tackon logoff-txt-dir @each-name))
  161.                     (textfile 
  162.                         (dest source-name) 
  163.                         (include source-name)
  164.                         (append logoff-text)
  165.                         (prompt "Are you sure you would like to have the following appended to "
  166.                                   "the '"source-name"' file?\n\n"logoff-text)
  167.                         (help "Selecting YES to this option will ALTER the '"source-name"' file "
  168.                                 "so that it will display the total connect time upon a user logoff.")
  169.                         (confirm "Expert") 
  170.                     ))
  171.                 ))
  172.             )
  173.         ))
  174.     ))
  175. )
  176.  
  177. (procedure copy-timeon-prg
  178.     (if (askbool
  179.         (prompt "Would you like to install the TimeOn door?")
  180.         (help "The TimeOn door displays a user's total connect time."))
  181.         ((copyfiles
  182.             (source source-dir) (dest UserID-Dir)
  183.             (pattern "TimeOn")
  184.             (files)
  185.         )
  186.         (add-timeon-logoff)
  187.     ))
  188. )
  189.  
  190. (procedure rename-old-dir
  191.     (set rename-text "Rename ")
  192.     (set rename-text (cat rename-text UserID-Dir))
  193.     (set rename-text (cat rename-text " "))
  194.     (set rename-text (cat rename-text UserID-Dir))
  195.     (set rename-text (cat rename-text "-Old"))
  196.     (run rename-text)
  197. )
  198.  
  199. (procedure add-userid-logoff-scp
  200.     (if (askbool
  201.         (prompt "Would you like to append the 'UserID UPDATE' command your MEBBSNet "
  202.                   "LogOff script?")
  203.         (help "Updating the LogOff script is necessary to use several of the text sequences. "
  204.                 "If you do not update this file you must ensure that you do not use the text "
  205.                 "sequences that require the 'UserID UPDATE' command or you must seek an alternate "
  206.                 "solution to updating the data file."))
  207.         ((set logoff-scp (askfile
  208.             (prompt "Select the LogOff Script file as defined in the Event_X.CFG file(s).")
  209.             (default "MEBBSNet:Scripts/LogOff.SCP");
  210.             (help "Select the LOGOFF filename as defined in the Event_X.CFG file."))
  211.         )
  212.  
  213.         (if (= 1 (exists logoff-scp)) (
  214.             (set logoff-scp-text UserID-Dir)
  215.             (set logoff-scp-text (cat logoff-scp-text "/UserID UPDATE"))
  216.             (if (askbool
  217.                 (prompt "Are you sure you would like to append the 'UserID UPDATE' command to the '"
  218.                           logoff-scp"' file.\n\n\n Appending Command: '"logoff-scp-text"'")
  219.                 (help "Selecting YES to this option will append the 'UserID UPDATE' command to the "
  220.                         logoff-scp" file.  This is necessary to use several text sequences."))
  221.                 (textfile (dest logoff-scp) (include logoff-scp) (append logoff-scp-text)))
  222.             )
  223.         ))
  224.     )
  225. )
  226.  
  227. (procedure make-userid-dir
  228.     (if(= 0 install-icons) (makedir(UserID-Dir)))
  229.     (if(= 1 install-icons) (makedir(UserID-Dir) (infos)))
  230. )
  231.  
  232. (procedure ask-install-icons
  233.     (set install-icons 0)
  234.     (if (askbool
  235.         (prompt "Would you like the icons installed for UserID?")
  236.         (help "Selecting YES to this option will create the respective icons so that "
  237.                 "the directory and documentation may be accessed through WorkBench."))
  238.         ((set install-icons 1))
  239.     )
  240. )
  241.  
  242. (procedure userid-update-install
  243.     (if(askbool
  244.         (prompt "You currently have "@app-name" installed, would you like to "
  245.                   "Update "@app-name"?")
  246.         (help "If you select YES to update, only the files that have changed since the "
  247.                 "LAST version will be copied, otherwise the complete package will be "
  248.                 "installed.\n\nNote: Old Files WILL be OVERWRITTEN, "
  249.                 "so make sure you make backups of older files if desired."))
  250.         (if(askbool
  251.             (prompt "Updating from VERSION 2.00 to 2.01\n\nWARNING the following "
  252.                       "files will be OVERWRITTEN:\n\n UserID\nUserID.guide\n\nAre "
  253.                       "you sure you would like to continue?")
  254.             (help "If you select YES to this option, older files will be OVERWRITTEN, "
  255.                     "and the new version will be installed."))
  256.             ((transcript "\nUpdate Installation...\n")
  257.             (complete 20) (ask-install-icons)
  258.             (complete 60) (copy-userid-prg)
  259.             (complete 80) (copy-userid-doc)
  260.             (install-exit))
  261.         )
  262.     )
  263.     (install-exit)
  264. )
  265.  
  266. (procedure userid-full-install
  267.     (transcript "\nFull Installation...\n")
  268.     (complete 15) (ask-install-icons)
  269.     (complete 18) (make-userid-dir)
  270.     (complete 20) (copy-userid-prg)
  271.     (complete 30) (copy-userid-dat)
  272.     (complete 40) (copy-userid-text)
  273.     (complete 50) (copy-userid-doc)
  274.     (complete 60) (add-userid-logoff-scp)
  275.     (complete 75) (add-userid-logon)
  276.     (complete 90) (copy-timeon-prg)
  277.     (complete 95) (copy-shell-games)
  278.     (install-exit)
  279. )
  280.  
  281. (complete 00) (transcript "Installation script for " @app-name ".")
  282. (complete 10) (select-destination-directory)
  283. (if(exists UserId-Dir (noreq)) (userid-update-install))
  284. (userid-full-install)
  285.